home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / plaf / basic / BasicComboBoxUI.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  15.8 KB  |  616 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Component;
  5. import java.awt.Dimension;
  6. import java.awt.Graphics;
  7. import java.awt.Insets;
  8. import java.awt.LayoutManager;
  9. import java.awt.Rectangle;
  10. import java.awt.event.FocusListener;
  11. import java.awt.event.ItemListener;
  12. import java.awt.event.KeyListener;
  13. import java.awt.event.MouseListener;
  14. import java.awt.event.MouseMotionListener;
  15. import java.beans.PropertyChangeListener;
  16. import javax.accessibility.Accessible;
  17. import javax.accessibility.AccessibleContext;
  18. import javax.swing.CellRendererPane;
  19. import javax.swing.ComboBoxEditor;
  20. import javax.swing.ComboBoxModel;
  21. import javax.swing.DefaultListCellRenderer;
  22. import javax.swing.JButton;
  23. import javax.swing.JComboBox;
  24. import javax.swing.JComponent;
  25. import javax.swing.JList;
  26. import javax.swing.JPopupMenu;
  27. import javax.swing.KeyStroke;
  28. import javax.swing.ListCellRenderer;
  29. import javax.swing.LookAndFeel;
  30. import javax.swing.SwingUtilities;
  31. import javax.swing.UIManager;
  32. import javax.swing.event.ListDataListener;
  33. import javax.swing.plaf.ComboBoxUI;
  34. import javax.swing.plaf.ComponentUI;
  35. import javax.swing.plaf.UIResource;
  36.  
  37. public class BasicComboBoxUI extends ComboBoxUI {
  38.    protected JComboBox comboBox;
  39.    protected boolean hasFocus = false;
  40.    private boolean lightNav = false;
  41.    private static final String LIGHTWEIGHT_KEYBOARD_NAVIGATION = "JComboBox.lightweightKeyboardNavigation";
  42.    private static final String LIGHTWEIGHT_KEYBOARD_NAVIGATION_ON = "Lightweight";
  43.    private static final String LIGHTWEIGHT_KEYBOARD_NAVIGATION_OFF = "Heavyweight";
  44.    protected JList listBox;
  45.    protected CellRendererPane currentValuePane = new CellRendererPane();
  46.    protected ComboPopup popup;
  47.    protected Component editor;
  48.    protected JButton arrowButton;
  49.    protected KeyListener keyListener;
  50.    protected FocusListener focusListener;
  51.    FocusListener editorFocusListener;
  52.    protected ItemListener itemListener;
  53.    protected PropertyChangeListener propertyChangeListener;
  54.    protected MouseListener popupMouseListener;
  55.    protected MouseMotionListener popupMouseMotionListener;
  56.    protected KeyListener popupKeyListener;
  57.    protected ListDataListener listDataListener;
  58.    protected boolean isMinimumSizeDirty = true;
  59.    protected Dimension cachedMinimumSize = new Dimension(0, 0);
  60.    Dimension cachedDisplaySize = new Dimension(0, 0);
  61.    static DefaultListCellRenderer textRenderer = new DefaultListCellRenderer();
  62.  
  63.    // $FF: synthetic method
  64.    static boolean access$0(BasicComboBoxUI var0) {
  65.       return var0.lightNav;
  66.    }
  67.  
  68.    // $FF: synthetic method
  69.    static void access$1(BasicComboBoxUI var0, boolean var1) {
  70.       var0.lightNav = var1;
  71.    }
  72.  
  73.    public void addEditor() {
  74.       this.removeEditor();
  75.       this.editor = this.comboBox.getEditor().getEditorComponent();
  76.       this.comboBox.add(this.editor);
  77.    }
  78.  
  79.    public void configureArrowButton() {
  80.       if (this.arrowButton != null) {
  81.          this.arrowButton.setEnabled(this.comboBox.isEnabled());
  82.          this.arrowButton.setRequestFocusEnabled(false);
  83.          if (this.popupMouseListener != null) {
  84.             this.arrowButton.addMouseListener(this.popupMouseListener);
  85.          }
  86.  
  87.          if (this.popupMouseMotionListener != null) {
  88.             this.arrowButton.addMouseMotionListener(this.popupMouseMotionListener);
  89.          }
  90.  
  91.          this.arrowButton.resetKeyboardActions();
  92.       }
  93.  
  94.    }
  95.  
  96.    protected void configureEditor() {
  97.       this.editor.setFont(this.comboBox.getFont());
  98.       if (this.popupKeyListener != null) {
  99.          this.editor.addKeyListener(this.popupKeyListener);
  100.       }
  101.  
  102.       if (this.editor instanceof Accessible) {
  103.          AccessibleContext var1 = ((Accessible)this.editor).getAccessibleContext();
  104.          if (var1 != null) {
  105.             var1.setAccessibleParent(this.comboBox);
  106.          }
  107.       }
  108.  
  109.       this.comboBox.configureEditor(this.comboBox.getEditor(), this.comboBox.getSelectedItem());
  110.    }
  111.  
  112.    protected JButton createArrowButton() {
  113.       return new BasicArrowButton(5);
  114.    }
  115.  
  116.    protected ComboBoxEditor createEditor() {
  117.       return new BasicComboBoxEditor.UIResource();
  118.    }
  119.  
  120.    protected FocusListener createFocusListener() {
  121.       return new FocusHandler(this);
  122.    }
  123.  
  124.    protected ItemListener createItemListener() {
  125.       return new ItemHandler(this);
  126.    }
  127.  
  128.    protected KeyListener createKeyListener() {
  129.       return new KeyHandler(this);
  130.    }
  131.  
  132.    protected LayoutManager createLayoutManager() {
  133.       return new ComboBoxLayoutManager(this);
  134.    }
  135.  
  136.    protected ListDataListener createListDataListener() {
  137.       return new ListDataHandler(this);
  138.    }
  139.  
  140.    protected ComboPopup createPopup() {
  141.       BasicComboPopup var1 = new BasicComboPopup(this.comboBox);
  142.       ((JPopupMenu)var1).getAccessibleContext().setAccessibleParent(this.comboBox);
  143.       return var1;
  144.    }
  145.  
  146.    protected PropertyChangeListener createPropertyChangeListener() {
  147.       return new PropertyChangeHandler(this);
  148.    }
  149.  
  150.    protected ListCellRenderer createRenderer() {
  151.       return new BasicComboBoxRenderer.UIResource();
  152.    }
  153.  
  154.    public static ComponentUI createUI(JComponent var0) {
  155.       return new BasicComboBoxUI();
  156.    }
  157.  
  158.    public Accessible getAccessibleChild(JComponent var1, int var2) {
  159.       switch (var2) {
  160.          case 0:
  161.             if (this.popup instanceof Accessible) {
  162.                AccessibleContext var4 = ((Accessible)this.popup).getAccessibleContext();
  163.                var4.setAccessibleParent(this.comboBox);
  164.                return (Accessible)this.popup;
  165.             }
  166.             break;
  167.          case 1:
  168.             if (this.comboBox.isEditable() && this.editor instanceof Accessible) {
  169.                AccessibleContext var3 = ((Accessible)this.editor).getAccessibleContext();
  170.                var3.setAccessibleParent(this.comboBox);
  171.                return (Accessible)this.editor;
  172.             }
  173.       }
  174.  
  175.       return null;
  176.    }
  177.  
  178.    public int getAccessibleChildrenCount(JComponent var1) {
  179.       return this.comboBox.isEditable() ? 2 : 1;
  180.    }
  181.  
  182.    protected Dimension getDefaultSize() {
  183.       ListCellRenderer var1 = this.comboBox.getRenderer();
  184.       Component var2 = textRenderer.getListCellRendererComponent(this.listBox, " ", -1, false, false);
  185.       this.currentValuePane.add(var2);
  186.       var2.setFont(this.comboBox.getFont());
  187.       int var3 = var2.getPreferredSize().height;
  188.       this.currentValuePane.remove(var2);
  189.       return new Dimension(100, var3);
  190.    }
  191.  
  192.    protected Dimension getDisplaySize() {
  193.       if (this.comboBox.isEditable() && this.comboBox.getModel().getSize() == 0) {
  194.          return new Dimension(100, this.editor.getPreferredSize().height);
  195.       } else {
  196.          Dimension var3 = new Dimension();
  197.          ListCellRenderer var4 = this.comboBox.getRenderer();
  198.          ComboBoxModel var5 = this.comboBox.getModel();
  199.          if (var4 != null && var5.getSize() > 0) {
  200.             int var1 = 0;
  201.  
  202.             for(int var2 = var5.getSize(); var1 < var2; ++var1) {
  203.                Component var6 = var4.getListCellRendererComponent(this.listBox, var5.getElementAt(var1), -1, false, false);
  204.                this.currentValuePane.add(var6);
  205.                var6.setFont(this.comboBox.getFont());
  206.                Dimension var7 = var6.getPreferredSize();
  207.                this.currentValuePane.remove(var6);
  208.                var3.width = Math.max(var3.width, var7.width);
  209.                var3.height = Math.max(var3.height, var7.height);
  210.             }
  211.  
  212.             if (this.comboBox.isEditable()) {
  213.                Dimension var8 = this.editor.getPreferredSize();
  214.                var3.width = Math.max(var3.width, var8.width);
  215.                var3.height = Math.max(var3.height, var8.height);
  216.             }
  217.  
  218.             this.cachedDisplaySize.setSize(var3.width, var3.height);
  219.             return var3;
  220.          } else {
  221.             return this.getDefaultSize();
  222.          }
  223.       }
  224.    }
  225.  
  226.    protected Insets getInsets() {
  227.       return this.comboBox.getInsets();
  228.    }
  229.  
  230.    public Dimension getMaximumSize(JComponent var1) {
  231.       Dimension var2 = this.getPreferredSize(var1);
  232.       var2.width = 32767;
  233.       return var2;
  234.    }
  235.  
  236.    public Dimension getMinimumSize(JComponent var1) {
  237.       if (!this.isMinimumSizeDirty) {
  238.          return new Dimension(this.cachedMinimumSize);
  239.       } else {
  240.          Insets var3 = this.getInsets();
  241.          Dimension var2 = this.getDisplaySize();
  242.          var2.height += var3.top + var3.bottom;
  243.          int var4 = var2.height - (var3.top + var3.bottom);
  244.          var2.width += var3.left + var3.right + var4;
  245.          this.cachedMinimumSize.setSize(var2.width, var2.height);
  246.          this.isMinimumSizeDirty = false;
  247.          return var2;
  248.       }
  249.    }
  250.  
  251.    public Dimension getPreferredSize(JComponent var1) {
  252.       Dimension var2 = this.getMinimumSize(var1);
  253.       var2.width += 4;
  254.       return var2;
  255.    }
  256.  
  257.    protected void installComponents() {
  258.       this.arrowButton = this.createArrowButton();
  259.       this.comboBox.add(this.arrowButton);
  260.       if (this.comboBox.isEditable()) {
  261.          this.addEditor();
  262.       }
  263.  
  264.       this.comboBox.add(this.currentValuePane);
  265.    }
  266.  
  267.    protected void installDefaults() {
  268.       LookAndFeel.installColorsAndFont(this.comboBox, "ComboBox.background", "ComboBox.foreground", "ComboBox.font");
  269.       LookAndFeel.installBorder(this.comboBox, "ComboBox.border");
  270.    }
  271.  
  272.    protected void installKeyboardActions() {
  273.       3 var1 = new 3(this);
  274.       this.comboBox.registerKeyboardAction(var1, KeyStroke.getKeyStroke(27, 0), 1);
  275.       this.comboBox.registerKeyboardAction(new 1.KeyToListDispatcher(this, 33), KeyStroke.getKeyStroke(33, 0), 1);
  276.       this.comboBox.registerKeyboardAction(new 1.KeyToListDispatcher(this, 34), KeyStroke.getKeyStroke(34, 0), 1);
  277.       this.comboBox.registerKeyboardAction(new 1.KeyToListDispatcher(this, 36), KeyStroke.getKeyStroke(36, 0), 1);
  278.       this.comboBox.registerKeyboardAction(new 1.KeyToListDispatcher(this, 35), KeyStroke.getKeyStroke(35, 0), 1);
  279.    }
  280.  
  281.    protected void installListeners() {
  282.       if ((this.itemListener = this.createItemListener()) != null) {
  283.          this.comboBox.addItemListener(this.itemListener);
  284.       }
  285.  
  286.       if ((this.propertyChangeListener = this.createPropertyChangeListener()) != null) {
  287.          this.comboBox.addPropertyChangeListener(this.propertyChangeListener);
  288.       }
  289.  
  290.       if ((this.keyListener = this.createKeyListener()) != null) {
  291.          this.comboBox.addKeyListener(this.keyListener);
  292.       }
  293.  
  294.       if ((this.focusListener = this.createFocusListener()) != null) {
  295.          this.comboBox.addFocusListener(this.focusListener);
  296.       }
  297.  
  298.       if ((this.popupMouseListener = this.popup.getMouseListener()) != null) {
  299.          this.comboBox.addMouseListener(this.popupMouseListener);
  300.       }
  301.  
  302.       if ((this.popupMouseMotionListener = this.popup.getMouseMotionListener()) != null) {
  303.          this.comboBox.addMouseMotionListener(this.popupMouseMotionListener);
  304.       }
  305.  
  306.       if ((this.popupKeyListener = this.popup.getKeyListener()) != null) {
  307.          this.comboBox.addKeyListener(this.popupKeyListener);
  308.       }
  309.  
  310.       if (this.comboBox.getModel() != null && (this.listDataListener = this.createListDataListener()) != null) {
  311.          this.comboBox.getModel().addListDataListener(this.listDataListener);
  312.       }
  313.  
  314.    }
  315.  
  316.    public void installUI(JComponent var1) {
  317.       this.isMinimumSizeDirty = true;
  318.       this.comboBox = (JComboBox)var1;
  319.       this.installDefaults();
  320.       this.popup = this.createPopup();
  321.       this.listBox = this.popup.getList();
  322.       Object var2 = var1.getClientProperty("JComboBox.lightweightKeyboardNavigation");
  323.       if (var2 != null) {
  324.          if (var2.equals("Lightweight")) {
  325.             this.lightNav = true;
  326.          } else if (var2.equals("Heavyweight")) {
  327.             this.lightNav = false;
  328.          }
  329.       }
  330.  
  331.       if (this.comboBox.getRenderer() == null || this.comboBox.getRenderer() instanceof UIResource) {
  332.          this.comboBox.setRenderer(this.createRenderer());
  333.       }
  334.  
  335.       if (this.comboBox.getEditor() == null || this.comboBox.getEditor() instanceof UIResource) {
  336.          this.comboBox.setEditor(this.createEditor());
  337.       }
  338.  
  339.       this.installComponents();
  340.       this.installListeners();
  341.       if (this.arrowButton != null) {
  342.          this.configureArrowButton();
  343.       }
  344.  
  345.       if (this.editor != null) {
  346.          this.configureEditor();
  347.       }
  348.  
  349.       this.comboBox.setLayout(this.createLayoutManager());
  350.       this.comboBox.setRequestFocusEnabled(true);
  351.       1 var3 = new 1(this);
  352.       SwingUtilities.invokeLater(var3);
  353.    }
  354.  
  355.    public boolean isFocusTraversable(JComboBox var1) {
  356.       return this.comboBox.isEditable() ^ true;
  357.    }
  358.  
  359.    protected boolean isNavigationKey(int var1) {
  360.       return var1 == 38 || var1 == 40 || var1 == KeyStroke.getKeyStroke("KP_UP").getKeyCode() || var1 == KeyStroke.getKeyStroke("KP_DOWN").getKeyCode();
  361.    }
  362.  
  363.    public boolean isPopupVisible(JComboBox var1) {
  364.       return this.popup.isVisible();
  365.    }
  366.  
  367.    public void paint(Graphics var1, JComponent var2) {
  368.       this.hasFocus = this.comboBox.hasFocus();
  369.       if (!this.comboBox.isEditable()) {
  370.          Rectangle var3 = this.rectangleForCurrentValue();
  371.          this.paintCurrentValueBackground(var1, var3, this.hasFocus);
  372.          this.paintCurrentValue(var1, var3, this.hasFocus);
  373.       }
  374.  
  375.    }
  376.  
  377.    public void paintCurrentValue(Graphics var1, Rectangle var2, boolean var3) {
  378.       ListCellRenderer var4 = this.comboBox.getRenderer();
  379.       if (this.comboBox.getSelectedIndex() != -1) {
  380.          Component var5;
  381.          if (var3 && !this.isPopupVisible(this.comboBox)) {
  382.             var5 = var4.getListCellRendererComponent(this.listBox, this.comboBox.getSelectedItem(), -1, true, false);
  383.          } else {
  384.             var5 = var4.getListCellRendererComponent(this.listBox, this.comboBox.getSelectedItem(), -1, false, false);
  385.             var5.setBackground(UIManager.getColor("ComboBox.background"));
  386.          }
  387.  
  388.          var5.setFont(this.comboBox.getFont());
  389.          if (var3 && !this.isPopupVisible(this.comboBox)) {
  390.             var5.setForeground(this.listBox.getSelectionForeground());
  391.             var5.setBackground(this.listBox.getSelectionBackground());
  392.          } else if (this.comboBox.isEnabled()) {
  393.             var5.setForeground(this.comboBox.getForeground());
  394.             var5.setBackground(this.comboBox.getBackground());
  395.          } else {
  396.             var5.setForeground(UIManager.getColor("ComboBox.disabledForeground"));
  397.             var5.setBackground(UIManager.getColor("ComboBox.disabledBackground"));
  398.          }
  399.  
  400.          this.currentValuePane.paintComponent(var1, var5, this.comboBox, var2.x, var2.y, var2.width, var2.height);
  401.       }
  402.    }
  403.  
  404.    public void paintCurrentValueBackground(Graphics var1, Rectangle var2, boolean var3) {
  405.       Color var4 = var1.getColor();
  406.       if (this.comboBox.isEnabled()) {
  407.          var1.setColor(UIManager.getColor("ComboBox.background"));
  408.       } else {
  409.          var1.setColor(UIManager.getColor("ComboBox.disabledBackground"));
  410.       }
  411.  
  412.       var1.fillRect(var2.x, var2.y, var2.width, var2.height);
  413.       var1.setColor(var4);
  414.    }
  415.  
  416.    protected Rectangle rectangleForCurrentValue() {
  417.       int var1 = this.comboBox.getWidth();
  418.       int var2 = this.comboBox.getHeight();
  419.       Insets var3 = this.getInsets();
  420.       int var4 = var2 - (var3.top + var3.bottom);
  421.       if (this.arrowButton != null) {
  422.          var4 = this.arrowButton.getWidth();
  423.       }
  424.  
  425.       return new Rectangle(var3.left, var3.top, var1 - (var3.left + var3.right + var4), var2 - (var3.top + var3.bottom));
  426.    }
  427.  
  428.    public void removeEditor() {
  429.       if (this.editor != null) {
  430.          this.unconfigureEditor();
  431.          this.comboBox.remove(this.editor);
  432.       }
  433.  
  434.    }
  435.  
  436.    void repaintCurrentValue() {
  437.       Rectangle var1 = this.rectangleForCurrentValue();
  438.       this.comboBox.repaint(var1.x, var1.y, var1.width, var1.height);
  439.    }
  440.  
  441.    protected void selectNextPossibleValue() {
  442.       int var1;
  443.       if (this.lightNav) {
  444.          var1 = this.listBox.getSelectedIndex();
  445.       } else {
  446.          var1 = this.comboBox.getSelectedIndex();
  447.       }
  448.  
  449.       if (var1 < this.comboBox.getModel().getSize() - 1) {
  450.          if (this.lightNav) {
  451.             this.listBox.setSelectedIndex(var1 + 1);
  452.             this.listBox.ensureIndexIsVisible(var1 + 1);
  453.          } else {
  454.             this.comboBox.setSelectedIndex(var1 + 1);
  455.          }
  456.  
  457.          this.comboBox.repaint();
  458.       }
  459.  
  460.    }
  461.  
  462.    protected void selectPreviousPossibleValue() {
  463.       int var1;
  464.       if (this.lightNav) {
  465.          var1 = this.listBox.getSelectedIndex();
  466.       } else {
  467.          var1 = this.comboBox.getSelectedIndex();
  468.       }
  469.  
  470.       if (var1 > 0) {
  471.          if (this.lightNav) {
  472.             this.listBox.setSelectedIndex(var1 - 1);
  473.             this.listBox.ensureIndexIsVisible(var1 - 1);
  474.          } else {
  475.             this.comboBox.setSelectedIndex(var1 - 1);
  476.          }
  477.  
  478.          this.comboBox.repaint();
  479.       }
  480.  
  481.    }
  482.  
  483.    public void setPopupVisible(JComboBox var1, boolean var2) {
  484.       if (var2) {
  485.          this.popup.show();
  486.       } else {
  487.          this.popup.hide();
  488.       }
  489.  
  490.    }
  491.  
  492.    protected void toggleOpenClose() {
  493.       this.setPopupVisible(this.comboBox, this.isPopupVisible(this.comboBox) ^ true);
  494.    }
  495.  
  496.    public void unconfigureArrowButton() {
  497.       if (this.arrowButton != null) {
  498.          if (this.popupMouseListener != null) {
  499.             this.arrowButton.removeMouseListener(this.popupMouseListener);
  500.          }
  501.  
  502.          if (this.popupMouseMotionListener != null) {
  503.             this.arrowButton.removeMouseMotionListener(this.popupMouseMotionListener);
  504.          }
  505.       }
  506.  
  507.    }
  508.  
  509.    protected void unconfigureEditor() {
  510.       if (this.popupKeyListener != null) {
  511.          this.editor.removeKeyListener(this.popupKeyListener);
  512.       }
  513.  
  514.    }
  515.  
  516.    protected void uninstallComponents() {
  517.       if (this.arrowButton != null) {
  518.          this.unconfigureArrowButton();
  519.       }
  520.  
  521.       if (this.editor != null) {
  522.          this.unconfigureEditor();
  523.       }
  524.  
  525.       this.comboBox.removeAll();
  526.       this.arrowButton = null;
  527.    }
  528.  
  529.    protected void uninstallDefaults() {
  530.       LookAndFeel.installColorsAndFont(this.comboBox, "ComboBox.background", "ComboBox.foreground", "ComboBox.font");
  531.       LookAndFeel.uninstallBorder(this.comboBox);
  532.    }
  533.  
  534.    protected void uninstallKeyboardActions() {
  535.       this.comboBox.unregisterKeyboardAction(KeyStroke.getKeyStroke(27, 0));
  536.       this.comboBox.unregisterKeyboardAction(KeyStroke.getKeyStroke(33, 0));
  537.       this.comboBox.unregisterKeyboardAction(KeyStroke.getKeyStroke(34, 0));
  538.       this.comboBox.unregisterKeyboardAction(KeyStroke.getKeyStroke(36, 0));
  539.       this.comboBox.unregisterKeyboardAction(KeyStroke.getKeyStroke(35, 0));
  540.    }
  541.  
  542.    protected void uninstallListeners() {
  543.       if (this.keyListener != null) {
  544.          this.comboBox.removeKeyListener(this.keyListener);
  545.       }
  546.  
  547.       if (this.itemListener != null) {
  548.          this.comboBox.removeItemListener(this.itemListener);
  549.       }
  550.  
  551.       if (this.propertyChangeListener != null) {
  552.          this.comboBox.removePropertyChangeListener(this.propertyChangeListener);
  553.       }
  554.  
  555.       if (this.focusListener != null) {
  556.          this.comboBox.removeFocusListener(this.focusListener);
  557.       }
  558.  
  559.       if (this.popupMouseListener != null) {
  560.          this.comboBox.removeMouseListener(this.popupMouseListener);
  561.       }
  562.  
  563.       if (this.popupMouseMotionListener != null) {
  564.          this.comboBox.removeMouseMotionListener(this.popupMouseMotionListener);
  565.       }
  566.  
  567.       if (this.popupKeyListener != null) {
  568.          this.comboBox.removeKeyListener(this.popupKeyListener);
  569.       }
  570.  
  571.       if (this.comboBox.getModel() != null && this.listDataListener != null) {
  572.          this.comboBox.getModel().removeListDataListener(this.listDataListener);
  573.       }
  574.  
  575.    }
  576.  
  577.    public void uninstallUI(JComponent var1) {
  578.       this.setPopupVisible(this.comboBox, false);
  579.       this.popup.uninstallingUI();
  580.       this.uninstallKeyboardActions();
  581.       this.comboBox.setLayout((LayoutManager)null);
  582.       this.uninstallComponents();
  583.       this.uninstallListeners();
  584.       this.uninstallDefaults();
  585.       if (this.comboBox.getRenderer() == null || this.comboBox.getRenderer() instanceof UIResource) {
  586.          this.comboBox.setRenderer((ListCellRenderer)null);
  587.       }
  588.  
  589.       if (this.comboBox.getEditor() == null || this.comboBox.getEditor() instanceof UIResource) {
  590.          this.comboBox.setEditor((ComboBoxEditor)null);
  591.       }
  592.  
  593.       this.keyListener = null;
  594.       this.focusListener = null;
  595.       this.listDataListener = null;
  596.       this.popupKeyListener = null;
  597.       this.popupMouseListener = null;
  598.       this.popupMouseMotionListener = null;
  599.       this.propertyChangeListener = null;
  600.       this.popup = null;
  601.       this.listBox = null;
  602.       this.comboBox = null;
  603.    }
  604.  
  605.    void updateToolTipTextForChildren() {
  606.       Component[] var1 = this.comboBox.getComponents();
  607.  
  608.       for(int var2 = 0; var2 < var1.length; ++var2) {
  609.          if (var1[var2] instanceof JComponent) {
  610.             ((JComponent)var1[var2]).setToolTipText(this.comboBox.getToolTipText());
  611.          }
  612.       }
  613.  
  614.    }
  615. }
  616.